package lwd;
import java.awt.*;
public class WordThread extends Thread
{
    int  time = 2000;
    char word;
    int k=65;
    Label com;
    WordThread(Label com)
    {  this.com=com;
    }
    public void run()
    {
        k=65;
        while(true)
        {
            word=(char)k;
            com.setText(""+word);
            try{  //【代码1】//调用sleep方法使得线程中断6000豪秒
                //sleep(6000);
                //更改为线程中断time毫秒
                sleep(time);
            }
            catch(InterruptedException e){}
            k++;
            if(k>=90) k=65;
        }
    }
    public void setTime(int n) {
        time = n;
    }
}